#if($!mapping)
<form id="pluginConfigForm" class="parsley-form" data-parsley-validate role="form" method="post" action="$!basePath/system/plugin/config/do">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h4 class="modal-title">插件参数配置</h4>
    </div>
    <div class="modal-body">
        <input type="hidden" name="className" value="$!className">
        #foreach($!map in $!mapping.entrySet())
            <div class="row">
                <div class="col-lg-12 col-md-12">
                    <div class="form-group">
                        <label class="control-label">$!map.value</label>
                        <input type="text" class="form-control" name="$!map.key" placeholder="$!map.value" value="$!props.getProperty($!map.key)">
                    </div>
                </div>
            </div>
        #end
    </div>
    <div class="modal-footer">
        <button id="ok" type="submit" class="btn btn-primary btn-form-submit" data-loading-text="正在保存...">提 交</button>
        <button type="button" class="btn btn-default" data-dismiss="modal">取 消</button>
    </div>

</form>
<script type="text/javascript">
    ns.requireJS("/framework/js/form/form.js");
    ns.requireJS("/framework/js/form/validator.js");
    ns.ready(function (dialog) {
        dialog.find("#pluginConfigForm").ajaxForm({
            beforeSubmit: function (arr, $form , options) {
                $form.find("#ok").button("loading");
            },
            success: function (data, statusText, xhr, $form) {
                if (data.success == true) {
                    ns.tip.toast.success("参数配置成功！");
                    ns.view.Dialog.close($form, {isConfig: true});
                } else {
                    ns.tip.toast.error(data.message);
                }
                $form.find("#ok").button("reset");
            }
        });
    });
</script>
#else
<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h4 class="modal-title">参数配置</h4>
</div>
<div class="modal-body">
    <div class="alert alert-warning">无参数可配置</div>
</div>
<div class="modal-footer">
    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
</div>
#end